/********************************************/
  // Creation History
  // --------------------------------------------------------------
  //	Company:			HTHK
  //	NAME:				AllICProjectReport.java
  //    Title   :			
  //	FUNCTION:
  //	BY:					Beyes Xia
  //	DATE:				2004-2-13 10:17
  // --------------------------------------------------------------
/*********************************************/

package tss.projectreport;

import javax.servlet.*;
import javax.servlet.http.*;

import java.io.*;
import java.sql.*;

import com.ffpc.sql.*;
import com.ffpc.struts.StrutsMessage;

import tss.common.DBServlet2;


public class ProjectReport extends DBServlet2
{
	@Override
	public String perform (HttpServletRequest req,HttpServletResponse res,StrutsMessage message)
		throws ServletException,IOException,SQLException,DataException,Exception
	{
		
		String condition = req.getParameter("condition");
        String type = req.getParameter("type");
        String chargeable =req.getParameter("chargeable");
        
        HttpSession session = req.getSession();
		session.setAttribute("s_condition",condition);
		session.setAttribute("s_type",type);
		session.setAttribute("s_chargeable",chargeable);        
        
/*        String companyName = req.getParameter("company_code");
		String cOrgName = "";
		String YearFrom = "";
		String YearTo = "";
		String monthFrom = "";
		String monthTo = "";
		
		if(req.getParameter("cOrg_name") != null && req.getParameter("cOrg_name").length() != 0)
	    	cOrgName = req.getParameter("cOrg_name");
		if(req.getParameter("year_from") != null && req.getParameter("year_from").length() != 0)
	    	YearFrom = req.getParameter("year_from");
		if(req.getParameter("month_from") != null && req.getParameter("month_from").length() != 0)
	    	monthFrom = req.getParameter("month_from");	    		    	
		if(req.getParameter("year_to") != null && req.getParameter("year_to").length() != 0)
	    	YearTo = req.getParameter("year_to");
		if(req.getParameter("month_to") != null && req.getParameter("month_to").length() != 0)
	    	monthTo = req.getParameter("month_to");	  
	    	
logger.debug("condition="+condition);
logger.debug("chargeable="+chargeable);
logger.debug("type="+type);
logger.debug("companyName="+companyName);
logger.debug("cOrgName="+cOrgName);
logger.debug("YearFrom="+YearFrom);
logger.debug("monthFrom="+monthFrom);
logger.debug("YearTo="+YearTo);
logger.debug("monthTo="+monthTo);	    	  		    		    	*/
          
		if (condition.equals("c") && type.equals("d") && chargeable.equals("c"))
		{
			return "servlet/tss.projectreport.CDCSearch";
		}
		if (condition.equals("g") && type.equals("d") && chargeable.equals("c"))
		{
			return "servlet/tss.projectreport.GDCSearch";
		}
		if (condition.equals("c") && type.equals("s") && chargeable.equals("c"))
		{
			return "servlet/tss.projectreport.CSCSearch";
		}
		if (condition.equals("g") && type.equals("s") && chargeable.equals("c"))
		{
			return "servlet/tss.projectreport.GSCSearch";
		}
						
		if (condition.equals("c") && type.equals("d") && chargeable.equals("i"))
		{
			return "servlet/tss.projectreport.CDISearch";
		}
		if (condition.equals("g") && type.equals("d") && chargeable.equals("i"))
		{
			return "servlet/tss.projectreport.GDISearch";
		}
		if (condition.equals("c") && type.equals("s") && chargeable.equals("i"))
		{
			return "servlet/tss.projectreport.CSISearch";
		}
		if (condition.equals("g") && type.equals("s") && chargeable.equals("i"))
		{
			return "servlet/tss.projectreport.GSISearch";
		}	

		if (condition.equals("c") && type.equals("d") && chargeable.equals("a"))
		{
			return "servlet/tss.projectreport.CDASearch";
		}
		if (condition.equals("g") && type.equals("d") && chargeable.equals("a"))
		{
			return "servlet/tss.projectreport.GDASearch";
		}
		if (condition.equals("c") && type.equals("s") && chargeable.equals("a"))
		{
			return "servlet/tss.projectreport.CSASearch";
		}
		if (condition.equals("g") && type.equals("s") && chargeable.equals("a"))
		{
			return "servlet/tss.projectreport.GSASearch";
		}			
		return "tss/projectreport/ProjectReport.jsp";									
	}
}

